package doyouknow.group.CnAndZhb.controller;

import doyouknow.group.CnAndZhb.entity.BCategory;
import doyouknow.group.CnAndZhb.entity.TblGateway;
import doyouknow.group.CnAndZhb.response.BaseControllerReturn;
import doyouknow.group.CnAndZhb.service.BCategoryService;
import doyouknow.group.CnAndZhb.utils.SerializedField;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * (BCategory)表控制层
 *
 * @author makejava
 * @since 2020-11-10 16:15:35
 */
@RestController
@RequestMapping("bCategory")
public class BCategoryController extends BaseController{
    /**
     * 服务对象
     */
    @Resource
    private BCategoryService bCategoryService;

    /**
     * 通过主键查询单条数据
     *
     * @param id 主键
     * @return 单条数据
     */
    @GetMapping("selectOne")
    @SerializedField(includes = {"id","title","content"})
    public Object selectOne(Integer id) {

        BCategory bCategory =  bCategoryService.queryById(id);
        return BaseControllerReturn.create(bCategory,null);
    }

}